<?php
namespace app\admin\model;
use app\common\model\Wxapp as WxappModel;
use think\Session;
/**
 * 微信小程序模型
 */
class Wxapp extends WxappModel
{
	/**
     * 管理员执行应用登录
     */
    public function appLogin()
    {
		if($store = StoreUser::detail($this->store_user_id)){
			// 保存登录状态
			Session::set('hema_store', [
				'user' => [
					'store_user_id' => $store['store_user_id'],
					'user_name' => $store['user_name'],
				],
				'wxapp' => $this->toArray(),
				'is_login' => true,
			]);
			return true;
		}
		return false;
    }

}

